package cn.com.cifi.mars.web.action.monitoringConsole;

import cn.com.cifi.mars.bean.vo.monitoringConsole.*;
import cn.com.cifi.mars.bean.vo.sys.rsp.UserDataPermissionVo;
import cn.com.cifi.mars.common.bean.R;
import cn.com.cifi.mars.common.constants.VersionConstant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 监控台
 *
 * @author Li
 */
@Api(tags = "监控台API")
@RequestMapping("/${spring.data.rest.base-path}/{apiVersion}/monitoringConsole")
public interface IMonitoringConsoleController {


    @ApiOperation(value = "货值监控", notes = "货值监控")
    @GetMapping(value = "valueMonitoring")
    public R<PriceValueVo> getValueMonitoring(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "组织机构id", required = true) @RequestParam(name = "orgId", defaultValue = "00000001") String orgId,
            @ApiParam(value = "截止年月(例如:201912)", required = true) @RequestParam(name = "reportDate", defaultValue = "201912") String reportDate
    );

    @ApiOperation(value = "核心指标监控", notes = "核心指标监控")
    @GetMapping(value = "coreQuota/store")
    public R<CoreQuotaVo> getCoreQuotaStore(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "组织机构id", required = true) @RequestParam(name = "orgId", defaultValue = "00000001") String orgId,
            @ApiParam(value = "截止年月(例如:201912)", required = true) @RequestParam(name = "reportDate", defaultValue = "201912") String reportDate,
            @ApiParam(value = "组织机构类型 11 旭辉集团,20 事业部/区域集团,21 城市公司,23 直管项目,31 项目,32 分期", required = true) @RequestParam(name = "hrOrgTypeId", defaultValue = "") String hrOrgTypeId
    );

    @ApiOperation(value = "监控指标-储明细", notes = "监控指标-储明细")
    @GetMapping(value = "storeItem")
    public R<StoreItemVo> getStoreItem(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "组织机构id", required = true) @RequestParam(name = "orgId", defaultValue = "00000001") String orgId,
            @ApiParam(value = "截止年月(例如:201912)", required = true) @RequestParam(name = "reportDate", defaultValue = "201912") String reportDate,
            @ApiParam(value = "组织机构类型 11 旭辉集团,20 事业部/区域集团,21 城市公司,23 直管项目,31 项目,32 分期", required = true) @RequestParam(name = "hrOrgTypeId", defaultValue = "") String hrOrgTypeId
    );

    @ApiOperation(value = "监控指标-产明细", notes = "监控指标-产明细")
    @GetMapping(value = "produceItem")
    public R<ProduceItemVo> getProduceItem(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "组织机构id", required = true) @RequestParam(name = "orgId", defaultValue = "00000001") String orgId,
            @ApiParam(value = "截止年月(例如:201912)", required = true) @RequestParam(name = "reportDate", defaultValue = "201912") String reportDate,
            @ApiParam(value = "组织机构类型 11 旭辉集团,20 事业部/区域集团,21 城市公司,23 直管项目,31 项目,32 分期", required = true) @RequestParam(name = "hrOrgTypeId", defaultValue = "") String hrOrgTypeId
    );

    @ApiOperation(value = "监控指标-供明细", notes = "监控指标-供明细")
    @GetMapping(value = "supplyItem")
    public R<SupplyItemVo> getSupplyItem(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "组织机构id", required = true) @RequestParam(name = "orgId", defaultValue = "00000001") String orgId,
            @ApiParam(value = "截止年月(例如:201912)", required = true) @RequestParam(name = "reportDate", defaultValue = "201912") String reportDate,
            @ApiParam(value = "组织机构类型 11 旭辉集团,20 事业部/区域集团,21 城市公司,23 直管项目,31 项目,32 分期", required = true) @RequestParam(name = "hrOrgTypeId", defaultValue = "") String hrOrgTypeId
    );

    @ApiOperation(value = "监控指标-销明细", notes = "监控指标-销明细")
    @GetMapping(value = "saleItem")
    public R<SaleItemVo> getSaleItem(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "组织机构id", required = true) @RequestParam(name = "orgId", defaultValue = "00000001") String orgId,
            @ApiParam(value = "截止年月(例如:201912)", required = true) @RequestParam(name = "reportDate", defaultValue = "201912") String reportDate,
            @ApiParam(value = "组织机构类型 11 旭辉集团,20 事业部/区域集团,21 城市公司,23 直管项目,31 项目,32 分期", required = true) @RequestParam(name = "hrOrgTypeId", defaultValue = "") String hrOrgTypeId
    );

    @ApiOperation(value = "监控指标-存明细", notes = "监控指标-存明细")
    @GetMapping(value = "stockItem")
    public R<StockItemVo> getStockItem(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "组织机构id", required = true) @RequestParam(name = "orgId", defaultValue = "00000001") String orgId,
            @ApiParam(value = "截止年月(例如:201912)", required = true) @RequestParam(name = "reportDate", defaultValue = "201912") String reportDate,
            @ApiParam(value = "组织机构类型 11 旭辉集团,20 事业部/区域集团,21 城市公司,23 直管项目,31 项目,32 分期", required = true) @RequestParam(name = "hrOrgTypeId", defaultValue = "") String hrOrgTypeId
    );

    @ApiOperation(value = "监控指标-结明细", notes = "监控指标-结明细")
    @GetMapping(value = "statementItem")
    public R<StatementItemVo> getStatementItem(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "组织机构id", required = true) @RequestParam(name = "orgId", defaultValue = "00000001") String orgId,
            @ApiParam(value = "截止年月(例如:201912)", required = true) @RequestParam(name = "reportDate", defaultValue = "201912") String reportDate,
            @ApiParam(value = "组织机构类型 11 旭辉集团,20 事业部/区域集团,21 城市公司,23 直管项目,31 项目,32 分期", required = true) @RequestParam(name = "hrOrgTypeId", defaultValue = "") String hrOrgTypeId
    );

    @ApiOperation(value = "监控指标-回明细", notes = "监控指标-回明细")
    @GetMapping(value = "returnItem")
    public R<ReturnItemVo> getReturnItem(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "组织机构id", required = true) @RequestParam(name = "orgId", defaultValue = "00000001") String orgId,
            @ApiParam(value = "截止年月(例如:201912)", required = true) @RequestParam(name = "reportDate", defaultValue = "201912") String reportDate,
            @ApiParam(value = "组织机构类型 11 旭辉集团,20 事业部/区域集团,21 城市公司,23 直管项目,31 项目,32 分期", required = true) @RequestParam(name = "hrOrgTypeId", defaultValue = "") String hrOrgTypeId
    );

    @ApiOperation(value = "监控台--用户的数据权限", notes = "监控台--用户的数据权限")
    @GetMapping(value = "dataPermissions")
    public R<UserDataPermissionVo> getMonitoringUserDataPermissions(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "用户id", required = true) @RequestParam(name = "userId", defaultValue = "000000661") String userId);


    @ApiOperation(value = "业态存销比", notes = "业态存销比")
    @GetMapping(value = "storeSaleRate")
    public R<List<StoreSaleRateVo>> getStoreSaleRate(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "组织机构id", required = true) @RequestParam(name = "orgId", defaultValue = "00000001") String orgId,
            @ApiParam(value = "截止年月(例如:201912)", required = true) @RequestParam(name = "reportDate", defaultValue = "201912") String reportDate
    );

    @ApiOperation(value = "测试保存预警提醒", notes = "测试保存预警提醒")
    @GetMapping(value = "warningReminderSave")
    public R<String> warningReminderSave(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "截止年月(例如:201912)", required = true) @RequestParam(name = "reportDate", defaultValue = "201912") String reportDate
    );
    
    @ApiOperation(value = "测试发送预警提醒", notes = "测试发送预警提醒")
    @GetMapping(value = "warningReminderSend")
    public R<String> warningReminderSend(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "截止年月(例如:201912)", required = true) @RequestParam(name = "reportDate", defaultValue = "201912") String reportDate,
            @ApiParam(value = "维度(a-储；b-产；c-供；d-销；e-存；f-结)", required = true) @RequestParam(name = "dimensionCode", defaultValue = "") String dimensionCode
    );


    @ApiOperation(value = "监控台--用户的数据权限V2", notes = "监控台--用户的数据权限V2")
    @GetMapping(value = "dataPermissionsV2")
    public R<UserDataPermissionVo> getMonitoringUserDataPermissionsV2(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "用户id", required = true) @RequestParam(name = "userId", defaultValue = "000000661") String userId);

    /**
     * pc端根据门户待办id消除待办,  4/待办转已办
     *
     * @param apiVersion
     * @param instanceId
     * @return
     */
    @ApiOperation(value = "pc端根据门户待办id消除待办", notes = "pc端根据门户待办id消除待办")
    @PostMapping(value = "updatePcEliminateToDo")
    R<String> updatePcEliminateToDo(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "待办id", required = true) @RequestParam(value = "instanceId") String instanceId);

    /**
     * app端根据门户待办id消除待办,  4/待办转已办
     * @return
     */
    @ApiOperation(value = "app端根据门户待办id消除待办", notes = "app端根据门户待办id消除待办")
    @PostMapping(value = "updateAppEliminateToDo")
    R<String> updateAppEliminateToDo(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "待办id", required = true) @RequestParam(value = "instanceId") String instanceId);

    /**
     * pc端根据门户待办id查看门户待办
     *
     * @param apiVersion
     * @param instanceId
     * @return
     */
    @ApiOperation(value = "pc端根据门户待办id查看门户待办", notes = "pc端根据门户待办id查看门户待办")
    @GetMapping(value = "getPcToDo")
    R<PortalTodoVo> getPcToDo(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "待办id", required = true) @RequestParam(value = "instanceId") String instanceId);

    /**
     * app端根据门户待办id查看门户待办
     *
     * @param apiVersion
     * @param instanceId
     * @return
     */
    @ApiOperation(value = "app端根据门户待办id查看门户待办", notes = "app端根据门户待办id查看门户待办")
    @GetMapping(value = "getAppToDo")
    R<PortalTodoVo> getAppToDo(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "待办id", required = true) @RequestParam(value = "instanceId") String instanceId);

    @ApiOperation(value = "生成监控台-回", notes = "生成监控台-回")
    @PostMapping(value = "/createReturn")
    R createReturn(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "时间年月", required = true, defaultValue = "2020-12") @RequestParam(name = "yearMonth") String yearMonth);


}
